home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / matrix.lha / Matrix / src / tMatrix.C < prev   
C/C++ Source or Header  |  1993-04-08  |  841b  |  37 lines

  1. //g++ -I../include -L../lib -O -o tMatrix tMatrix.C -lMatrix -lg++     -lm
  2. //CC  -I../include -L../lib -O -o tMatrix tMatrix.C -lMatrix -lcomplex -lm
  3. #include <complex.Matrix.h>
  4. #define matrix complexMatrix
  5.  
  6. int main() {
  7.   matrix x(2, 2, complex(1.0, sqrt(3.0)));
  8.   x[1][1]     = -x[0][0];
  9.   x[0][1]     = conj(x[1][0]);
  10.   cout    <<"     x "<< "\n"
  11.       <<      x  << "\n"
  12.       <<"sqrt(x)"<< "\n"
  13.       << sqrt(x) << "\n"
  14.       <<"conj(x)"<< "\n"
  15.       << conj(x) << "\n"
  16.       <<"cosh(x)"<< "\n"
  17.       << cosh(x) << "\n"
  18.       <<"sinh(x)"<< "\n"
  19.       << sinh(x) << "\n"
  20.       <<" cos(x)"<< "\n"
  21.       <<  cos(x) << "\n"
  22.       <<" sin(x)"<< "\n"
  23.       <<  sin(x) << "\n"
  24.       <<" abs(x)"<< "\n"
  25.       <<  abs(x) << "\n"
  26.      <<"norm(x)"<< "\n"
  27.      << norm(x) << "\n"
  28.     <<" arg(x)"<< "\n"
  29.     <<  arg(x) << "\n"
  30.     <<"real(x)"<< "\n"
  31.     << real(x) << "\n"
  32.     <<"imag(x)"<< "\n"
  33.     << imag(x) << "\n"
  34.     ;
  35.   }
  36.  
  37.